<template>
	<view class="pages">
		<!-- #ifndef H5 -->
		<statusBar></statusBar>
		<!-- #endif -->

		<u-toast ref="msgToast" />

		<!-- publish popup -->
		<!-- <u-popup mode="bottom" height="300" v-model="popupIsShow">
			<u-row>
				<u-col span="12">.
					<u-row style="width: 100%;">
						<u-col span="6" align="top" style="padding: 30rpx 0 20rpx 20rpx;">
							<text>选择类别</text>
						</u-col>
						<u-col span="6" align="bottom" style="padding: 30rpx 20rpx 20rpx 0;" @click="showPop(0)">
							取消
						</u-col>
					</u-row>
				</u-col>
				<u-col span="12">
					<swiper @change="changesw" style="width: 100%;height: 160rpx;">
						<template v-for="(item, index) in PubCateCount">
							<swiper-item>
								<u-grid :col="4" :border="false">
									<template v-for="(chitem, chindex) in PubCateList.slice(4*index,4*(index+1))">
										<u-grid-item bg-color="transparent" @click="ToPub(chitem.cate)">
											<u-icon :name="chitem.iconame" :size="60"></u-icon>
											<view class="u-font-12">{{chitem.txt}}</view>
										</u-grid-item>
									</template>
								</u-grid>
							</swiper-item>
						</template>
					</swiper>
				</u-col>
			</u-row>
		</u-popup> -->
		<u-mask :custom-style="maskCss" :show="popupIsShow" @tap="popupIsShow = false">
			<u-row class="catePop" :style="cateBoxTop">
				<template v-for="(chitem, chindex) in PubCateList">
					<u-col span="12" style="padding: 20rpx 0;" @tap="ToPub(chitem.cate)">
						<u-icon :name="chitem.iconame" :size="50" :label="chitem.txt" label-color="#ffffff"
							label-size="26"></u-icon>
					</u-col>
				</template>
			</u-row>
		</u-mask>

		<!-- top nav bar -->
		<u-navbar :background="picBg" back-icon-name="map" back-icon-size="30"
			:back-text="curlocaltion.length>2?curlocaltion.substr(0,2)+'...':curlocaltion"
			:back-text-style="navlefttext" back-icon-color="#ffffff" :border-bottom="false">
			<view class="slot-wrap search-wrap" @click.capture="searchClick">
				<u-search style="width: 100%;" height="54" placeholder="搜一搜~生活变得更精彩" bg-color="#ffffff"
					search-icon-color="#999999" placeholder-color="#999999" v-model="keyword" :show-action="false">
				</u-search>
			</view>
			<view slot="right" @tap="showPop(1)" style="color: #ffffff; padding: 14rpx 24rpx 14rpx 14rpx;">
				<!-- size="46" label="发布" label-size="20" label-pos="right"  -->
				<u-icon name="edit-pen" size="30" label="发布" label-size="28" label-color="#ffffff" label-pos="right">
				</u-icon>
			</view>
		</u-navbar>

		<!-- top nav -->
		<view :style="topbox">
			<u-grid :col="4" :border="false" :style="topnavbox">
				<template v-for="(item,index) in gridnavList">
					<u-grid-item bg-color="transparent">
						<u-icon :name="item.iconame" :size="60"></u-icon>
						<view class="gridnavtxt u-font-12">{{item.txt}}</view>
					</u-grid-item>
				</template>
			</u-grid>
		</view>

		<!-- child nav list -->
		<swiper :style="topnavChildbox" @change="changesw">
			<template v-for="(item, index) in swnavcount">
				<swiper-item>
					<u-grid :col="4" :border="false">
						<u-grid-item bg-color="transparent"
							v-for="(chitem, chindex) in gridnavChildList.slice(8*index,8*(index+1))">
							<u-icon :name="chitem.iconame" :size="60"></u-icon>
							<view class="u-font-12">{{chitem.txt}}</view>
						</u-grid-item>
					</u-grid>
				</swiper-item>
			</template>
		</swiper>
		<u-grid align="center" :col="swnavcount" :border="false" :style="chilnavbotton">
			<template v-for="(intm,index) in swnavcount">
				<view class="indicator-dots-item" :class="[current == index ? 'indicator-dots-active' : '']">
				</view>
			</template>
		</u-grid>

		<!-- 会员签到 block -->
		<u-row gutter="0" style="margin:40rpx 36rpx 6rpx;">
			<u-col span="6">
				<u-row class="sel-box-shadow sel-box-shadow1" style="margin-right: 16rpx;">
					<u-col span="6" align="top" class="u-font-12">
						<u-row gutter="0" style="width: 100%;">
							<u-row class="u-font-14 signboxtxt" span="12" align="top">会员签到</u-row>
							<u-col class="u-font-11" span="12" align="top" style="color: #999999;font-size: 24rpx;">赢取积分
							</u-col>
						</u-row>
					</u-col>
					<u-col span="6" align="bottom">
						<u-avatar size="large" mode="square" :src="picSignUrl" style="padding: 10rpx;"></u-avatar>
					</u-col>
				</u-row>
			</u-col>
			<u-col span="6">
				<u-row class="sel-box-shadow sel-box-shadow2" style="margin-left: 10rpx;">
					<u-col span="6" align="top" class="u-font-12">
						<u-row gutter="0" style="width: 100%;">
							<u-row class="u-font-14 signboxtxt" span="12" align="top">精选礼品</u-row>
							<u-col span="12" align="top" style="color: #999999;font-size: 24rpx;">个人专属</u-col>
						</u-row>
					</u-col>
					<u-col span="6" align="bottom">
						<u-avatar size="large" mode="square" :src="picGiftUrl" style="padding: 10rpx;"></u-avatar>
					</u-col>
				</u-row>
			</u-col>
		</u-row>

		<!-- AD List -->
		<!-- <u-swiper height="120" border-radius="8" :list="swlist" :style="swiperAD"></u-swiper> -->

		<!-- 榜单 -->
		<u-tabs-swiper ref="uTabs" swiperWidth="750" :is-scroll="false" :list="tabDatas" :current="tabcurrent"
			@change="tabsChange"></u-tabs-swiper>
		<swiper style="height: 700rpx;width: 100%;" :current="swiperCurrent" @transition="transition"
			@animationfinish="animationfinish">
			<swiper-item class="swiper-item" v-for="item in tabDatas">
				<u-row gutter="0" style="margin: 0 36rpx;">
					<u-col span="12" align="top">
						<template v-for="(item,index) in topUsers" :index="index">
							<u-row gutter="0" style="width: 100%;">
								<u-col span="2">
									<u-row gutter="0">
										<u-col span="12" align="top" style="padding: 0 0 30rpx;">
											<template v-if="index==0">
												<u-tag mode="dark" shape="circleRight" :text="index+1" type="error"
													style="font-weight: bolder;" />
											</template>
											<template v-else-if="index==1">
												<u-tag mode="dark" shape="circleRight" :text="index+1"
													bg-color="#ef940b" style="font-weight: bolder;" />
											</template>
											<template v-else-if="index==2">
												<u-tag mode="dark" shape="circleRight" :text="index+1"
													bg-color="#f1b451" style="font-weight: bolder;" />
											</template>
											<template v-else>
												<u-tag mode="dark" shape="circleRight" :text="index+1" type="info"
													style="font-weight: bolder;" />
											</template>
										</u-col>
										<u-col span="12" align="top" class="u-font-12 u-light-color"
											style="padding:8rpx 0 2rpx;">评分</u-col>
										<u-col span="12" align="top" style="font-weight: bolder;color: #333333;">
											{{item.rateval}}
										</u-col>
									</u-row>
								</u-col>
								<u-col span="4">
									<u-avatar mode="square" size="160" :show-level="true" :src="item.avaraturl">
									</u-avatar>
								</u-col>
								<u-col span="6">
									<u-row gutter="0" :style="topuserrightbox">
										<u-col span="1" align="top" text-align="left">
											<u-icon name="account" color="#007aff"></u-icon>
										</u-col>
										<u-col span="11" align="top" text-align="left">
											<view class="u-line-1">
												{{item.name.length>10?item.name.substr(0,10)+"...":item.name}}
											</view>
										</u-col>
									</u-row>
									<u-row gutter="0" :style="topuserrightbox">
										<u-col span="1" align="top" text-align="left">
											<u-icon name="phone" color="#f29100"></u-icon>
										</u-col>
										<u-col span="11" align="top" text-align="left">
											<view>{{frmPhone(item.tell)}}</view>
										</u-col>
									</u-row>
									<u-row gutter="0" :style="topuserrightbox">
										<u-col span="1" align="top" text-align="left">
											<u-icon name="map" color="#9c26b0"></u-icon>
										</u-col>
										<u-col span="11" align="top" text-align="left" class="u-line-1">
											{{item.linkaddr.length>10?item.linkaddr.substr(0,10)+"...":item.linkaddr}}
										</u-col>
									</u-row>
								</u-col>
							</u-row>
						</template>
					</u-col>
				</u-row>
			</swiper-item>
		</swiper>

		<!-- <u-row gutter="0" style="margin: 0 20rpx;">
			<u-col span="12" align="top">
				<h4>装修榜单</h4>
			</u-col>
			<u-col span="12" align="top">
				<template v-for="(item,index) in topUsers">
					<u-row gutter="0" style="width: 100%;">
						<u-col span="2">
							<u-row gutter="0">
								<u-col span="12" style="padding: 0 0 30rpx;">
									<u-tag mode="dark" :text="index+1" type="success" />
								</u-col>
								<u-col span="12" class="u-font-12 u-light-color" style="padding:8rpx 0 2rpx;">评分</u-col>
								<u-col span="12" style="font-weight: bolder;color: #333333;">{{item.rateval}}</u-col>
							</u-row>
						</u-col>
						<u-col span="4">
							<u-avatar mode="square" size="160" :show-level="true" :src="item.avaraturl"></u-avatar>
						</u-col>
						<u-col span="6">
							<u-row gutter="0" :style="topuserrightbox">
								<u-col span="1" align="top" text-align="left">
									<u-icon name="account" color="#007aff"></u-icon>
								</u-col>
								<u-col span="11" align="top" text-align="left">
									<view>{{item.name}}</view>
								</u-col>
							</u-row>
							<u-row gutter="0" :style="topuserrightbox">
								<u-col span="1" align="top" text-align="left">
									<u-icon name="phone" color="#f29100"></u-icon>
								</u-col>
								<u-col span="11" align="top" text-align="left">
									<view>{{item.tell}}</view>
								</u-col>
							</u-row>
							<u-row gutter="0" :style="topuserrightbox">
								<u-col span="1" align="top" text-align="left">
									<u-icon name="map" color="#9c26b0"></u-icon>
								</u-col>
								<u-col span="11" align="top" text-align="left" class="u-line-1">
									{{item.linkaddr}}
								</u-col>
							</u-row>
						</u-col>
					</u-row>
					<u-gap height="8" bg-color="#bbb"></u-gap>
				</template>
			</u-col>
		</u-row> -->

		<!-- AD List -->
		<u-swiper height="100" border-radius="8" mode="none" :list="swlist" :style="swiperAD"></u-swiper>

		<!-- 资讯 -->
		<unicloud-db ref='udb' v-slot:default="{data,pagination,hasMore, loading, error, options}" @error="onqueryerror"
			:where="where" collection="opendb-news-articles,uni-id-users" :page-size="10"
			field="avatar,title,last_modify_date,user_id.username">
			<u-row gutter="0" style="margin: 20rpx 36rpx;">
				<u-col span="11" align="top">
					<h4>资讯</h4>
				</u-col>
				<u-col span="1" align="bottom">
					<u-icon name="arrow-right"></u-icon>
				</u-col>
			</u-row>
			<template v-for="(item,index) in data">
				<u-row gutter="0" @click="toDetail(item._id,item.title)" :key="index" style="margin: 0rpx 36rpx;">
					<u-col span="9">
						<u-row gutter="0" style="width: 100%; padding: 0 0 20rpx;">
							<u-col span="12">
								<text class="u-line-2">{{item.title}}</text>
							</u-col>
						</u-row>
						<u-row gutter="0" style="width: 100%;">
							<u-col align="top" span="6">
								<text class="u-font-13 u-tips-color">{{item.user_id[0].username}}</text>
							</u-col>
							<u-col align="bottom" span="6">
								<text class="u-font-13 u-tips-color">{{frtDate(item.last_modify_date)}}</text>
							</u-col>
						</u-row>
					</u-col>
					<u-col span="3" align="bottom">
						<u-avatar mode="square" size="140" :src="item.avatar"></u-avatar>
					</u-col>
				</u-row>
			</template>
		</unicloud-db>

		<u-gap height="0" margin-bottom="50"></u-gap>

		<!-- 搜索功能 old logic -->
		<!-- <uni-search-bar @click="searchClick" class="uni-search-box" v-model="keyword" ref="searchBar" radius="100"
			cancelButton="none" disabled />
		<view class="cover-search-bar" @click="searchClick"></view>
		<unicloud-db ref='udb' v-slot:default="{data,pagination,hasMore, loading, error, options}" @error="onqueryerror"
			:where="where" collection="opendb-news-articles,uni-id-users" :page-size="10"
			field="avatar,title,last_modify_date,user_id.username">
			<uni-list class="uni-list" :border="false" :bounce="true" :alwaysScrollableVertical="true"
				:style="{height:listHight}">
				<uni-list-item :to="'/pages/list/detail?id='+item._id+'&title='+item.title" v-for="(item,index) in data"
					:key="index">
					<template v-slot:header>
						<image class="avatar" :src="item.avatar" mode="aspectFill"></image>
					</template>
					<template v-slot:body>
						<view class="main">
							<text class="title">{{item.title}}</text>
							<view class="info">
								<text class="author">{{item.user_id[0].username}}</text>
								<uni-dateformat class="last_modify_date" :date="item.last_modify_date"
									format="yyyy-MM-dd" :threshold="[60000, 2592000000]" />
							</view>
						</view>
					</template>
				</uni-list-item>
				<uni-list-item>
					<template v-slot:body>
						<uni-load-state @networkResume="refresh" :state="{data,pagination,hasMore, loading, error}">
						</uni-load-state>
					</template>
				</uni-list-item>
			</uni-list>
		</unicloud-db> -->
	</view>
</template>

<script>
	var cdbRef, currentWebview;
	import statusBar from "@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar";
	import Gps from '@/uni_modules/json-gps/js_sdk/gps.js';
	const gps = new Gps();
	import {
		formatDate
	} from '../common/DateTool/dateFormat.js';

	export default {
		components: {
			statusBar
		},
		data() {
			return {
				where: "",
				keyword: "",
				refreshState: 0,
				listHight: 0,

				popupIsShow: false,
				curlocaltion: "豆豆村",
				navlefttext: {
					"color": '#ffffff',
					"font-size": '28rpx',
					"font-weight": "bolder"
				},
				tranbg: {
					"background": "transparent"
				},
				picSignUrl: '/static/topnav/otherNav/sign.png',
				picGiftUrl: '/static/topnav/otherNav/gift.png',
				picBg: {
					"background": "url('/static/topnav/navBg/bg.png')"
				},
				topbox: {
					"position": "absolute",
					"top": "0",
					"background": "url('/static/topnav/navBg/bg.png')",
					"background-repeat": "no-repeat",
					"width": "100%"
				},
				topnavbox: {
					"margin": "13% 0 0"
				},
				gridnav: {
					"padding": "0"
				},
				gridnavList: [{
					iconame: "../../static/topnav/paint.png",
					txt: "家装修"
				}, {
					iconame: "../../static/topnav/work.png",
					txt: "找工作"
				}, {
					iconame: "../../static/topnav/car.png",
					txt: "拼车团"
				}, {
					iconame: "../../static/topnav/shopping.png",
					txt: "购物圈"
				}],
				topnavChildbox: {
					"margin": "23% 0 0"
				},
				chilnavbotton: {
					"margin-top": "3%"
				},
				swiperAD: {
					"margin": "5% 36rpx 16rpx"
				},
				current: 0,
				swnavcount: 0,
				gridnavChildList: [{
					iconame: "/static/topnav/childNav/design.png",
					txt: "找设计"
				}, {
					iconame: "/static/topnav/childNav/water.png",
					txt: "水电工"
				}, {
					iconame: "/static/topnav/childNav/stone.png",
					txt: "泥瓦工"
				}, {
					iconame: "/static/topnav/childNav/wood.png",
					txt: "木材工"
				}, {
					iconame: "/static/topnav/childNav/paint.png",
					txt: "油漆工"
				}, {
					iconame: "/static/topnav/childNav/cleaning.png",
					txt: "保洁工"
				}, {
					iconame: "/static/topnav/childNav/recovery.png",
					txt: "物料回收"
				}, {
					iconame: "/static/topnav/childNav/owner.png",
					txt: "业主单"
				}, {
					iconame: "/static/topnav/childNav/hourse.png",
					txt: "出租房"
				}, {
					iconame: "/static/topnav/childNav/teach.png",
					txt: "请家教"
				}, {
					iconame: "/static/topnav/childNav/truck.png",
					txt: "找搬运"
				}, {
					iconame: "/static/topnav/childNav/baby.png",
					txt: "育儿圈"
				}, {
					iconame: "/static/topnav/childNav/vlog.png",
					txt: "VLog"
				}, {
					iconame: "/static/topnav/childNav/botany.png",
					txt: "养植物"
				}, {
					iconame: "/static/topnav/childNav/fishing.png",
					txt: "野垂钓"
				}, {
					iconame: "/static/topnav/childNav/more.png",
					txt: "更多服务"
				}],
				swlist: [{
						image: "/static/tabbar/sw1.gif"
					},
					{
						image: '/static/tabbar/sw2.jpeg'
					},
					{
						image: '/static/tabbar/sw3.jpeg'
					},
					{
						image: '/static/tabbar/sw4.jpeg'
					}
				],
				tabcurrent: 0,
				swiperCurrent: 0,
				tabDatas: [{
					name: '排行榜单'
				}, {
					name: '热门精选'
				}, {
					name: '为您推荐'
				}, {
					name: '口碑好评'
				}],
				topUsers: [{
					name: "豆豆",
					rateval: "98.7",
					tell: "13556846045",
					linkaddr: "江南市安宁区松动街道办豆豆家族村001号",
					avaraturl: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-6229d433-d358-43b9-9dce-b95ae1e31599/23cc07c4-292b-4f43-a492-321ace99e3d8.jpg"
				}, {
					name: "豆妈",
					rateval: "98.5",
					tell: "13556846045",
					linkaddr: "江南市安宁区松动街道办豆豆家族村001号",
					avaraturl: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-6229d433-d358-43b9-9dce-b95ae1e31599/e3d4bb76-ce34-47c5-9486-cc46bcd45735.jpg"
				}, {
					name: "豆爸",
					rateval: "98.3",
					tell: "13556846045",
					linkaddr: "江南市安宁区松动街道办豆豆家族村001号",
					avaraturl: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-6229d433-d358-43b9-9dce-b95ae1e31599/23cc07c4-292b-4f43-a492-321ace99e3d8.jpg"
				}, {
					name: "余李同行",
					rateval: "95",
					tell: "13556846045",
					linkaddr: "江南市安宁区松动街道办豆豆家族村001号",
					avaraturl: "https://vkceyugu.cdn.bspapp.com/VKCEYUGU-6229d433-d358-43b9-9dce-b95ae1e31599/23cc07c4-292b-4f43-a492-321ace99e3d8.jpg"
				}],
				topuserrightbox: {
					"width": "100%",
					"padding": "10rpx 0"
				},
				cateBoxTop: {
					"top": "6%"
				},
				maskCss: {
					'background-color': 'rgba(0, 0, 0, 0.15)'
				},
				PubCateCount: 0,
				PubCateList: [{
					cate: "workerPub",
					iconame: "../../static/topnav/pubNav/set-house.png",
					txt: "装修发单"
				}, {
					cate: "proprietorPub",
					iconame: "../../static/topnav/pubNav/proprietor.png",
					txt: "业主发单"
				}, {
					cate: "newsPub",
					iconame: "../../static/topnav/pubNav/pub-news.png",
					txt: "生活动态"
				}, {
					cate: "outhousePub",
					iconame: "../../static/topnav/pubNav/out-house.png",
					txt: "房源出租"
				}, {
					cate: "recovery",
					iconame: "../../static/topnav/pubNav/recovery.png",
					txt: "物料回收"
				}]
			}
		},
		watch: {
			keyword(keyword, oldValue) {
				if (keyword) {
					this.where = `/${keyword}/.test(title)`;
				} else {
					this.where = '';
				}
			}
		},
		async onReady() {
			var _swnavcount = this.gridnavChildList.length;
			this.swnavcount = Math.floor(_swnavcount / 8) + (_swnavcount % 8 == 0 ? 0 : 1);

			var _pubCateCount = this.PubCateList.length;
			this.PubCateCount = Math.floor(_pubCateCount / 4) + (_pubCateCount % 4 == 0 ? 0 : 1);

			// #ifdef APP-PLUS
			var motionInfos = uni.getSystemInfoSync().statusBarHeight; //导航栏的高度	
			console.log("motionInfos:" + motionInfos);

			if (motionInfos > 24) {
				this.topnavbox = {
					"margin": "18% 0 0"
				};
				this.topnavChildbox = {
					"margin": "12% 0 0"
				};
				this.chilnavbotton = {
					"margin-top": "3%"
				};
			}
			this.cateBoxTop = {
				"top": motionInfos * 4 + "rpx"
			};
			// #endif

			// #ifdef H5
			this.topnavChildbox = {
				"margin": "20% 0 0"
			};
			this.chilnavbotton = {
				"margin-top": "0%"
			};
			this.topnavbox = {
				"margin": "10% 0 0"
			}
			this.cateBoxTop = {
				"top": "6%"
			};
			// #endif

			// #ifdef APP-NVUE
			this.listHight = uni.getSystemInfoSync().windowHeight - 96 + 'px'
			// #endif
			// #ifndef APP-NVUE
			this.listHight = 'auto'
			// #endif
			cdbRef = this.$refs.udb
		},
		async onShow() {
			this.keyword = getApp().globalData.searchText
			getApp().globalData.searchText = ''
			//这里仅演示如何，在onShow生命周期获取设备位置，并在设备或者应用没有权限时自动引导。设置完毕自动重新获取。
			//你可以基于他做自己的业务，比如：根据距离由近到远排序列表数据等
			// uni.showLoading({
			// 	title:"获取定位中"
			// });

			// let location = await gps.getLocation({
			// 	geocode: true
			// })
			// console.log(location);

			// if(location){
			// 	uni.showToast({
			// 		title: JSON.stringify(location),
			// 		icon: 'none'
			// 	});
			// }
			// uni.hideLoading()
		},
		methods: {
			ToPub(_cate) {
				//_cate-->workerPub proprietorPub outhousePub newsPub
				console.log("_cate:" + _cate)
				if (_cate) {
					this.popupIsShow = false;
					var _tourl = '/pages/pubs/pub/pub?_cate=' + _cate;
					uni.navigateTo({
						url: _tourl
					});
				} else {
					this.$refs.msgToast.show({
						title: '此功能暂为开放！',
						type: 'warning'
					});
				}
			},
			showPop(_val) {
				this.popupIsShow = _val == 1 ? true : false;
				// if (_val == 1) {
				// 	this.$u.route("/pages/list/pubCateWin/pubCateWin");
				// }
			},
			toDetail(_id, _title) {
				var _tourl = '/pages/list/detail?id=' + _id + '&title=' + _title;
				uni.navigateTo({
					url: _tourl
				});
			},
			frmPhone(_tel) {
				if (_tel) {
					_tel = "" + _tel;
					_tel = _tel.substr(0, 3) + "****" + _tel.substr(7);
				} else {
					_tel = "";
				}
				return _tel;
			},
			tabsChange(index) {
				this.swiperCurrent = index;
			},
			// swiper-item左右移动，通知tabs的滑块跟随移动
			transition(e) {
				let dx = e.detail.dx;
				this.$refs.uTabs.setDx(dx);
			},
			// 由于swiper的内部机制问题，快速切换swiper不会触发dx的连续变化，需要在结束时重置状态
			// swiper滑动结束，分别设置tabs和swiper的状态
			animationfinish(e) {
				let current = e.detail.current;
				this.$refs.uTabs.setFinishCurrent(current);
				this.swiperCurrent = current;
				this.tabcurrent = current;
			},
			// scroll-view到底部加载更多
			onreachBottom() {

			},
			changesw(e) {
				this.current = e.detail.current;
			},
			frtDate(value) {
				let date = new Date(value);
				return formatDate(date, 'yyyy-MM-dd')
			},
			searchClick(e) { //点击搜索框
				uni.hideKeyboard();
				uni.navigateTo({
					url: '/pages/list/search/search',
					animationType: 'fade-in'
				});
			},
			retry() {
				this.refresh()
			},
			refresh() {
				console.log('----platform----');
				console.log(JSON.stringify(process.env.VUE_APP_PLATFORM));
				cdbRef.loadData({
					clear: true
				}, () => {
					uni.stopPullDownRefresh()
				})
				console.log('refresh');
			},
			onqueryerror(e) {
				console.log(e);
			}
		},
		// onPullDownRefresh() {
		// 	//下拉刷新
		// 	this.refresh()
		// },
		// onReachBottom() {
		// 	cdbRef.loadMore({
		// 		clear: true
		// 	})
		// }
	}
</script>

<style scoped>
	.sel-box-shadow {
		width: 95%;
		padding: 2rpx 10rpx;
		border-radius: 8rpx;
	}

	.sel-box-shadow1 {
		background-color: #e5f9fb;
	}

	.sel-box-shadow2 {
		background-color: #daedfd;
	}

	.signboxtxt {
		margin: 0% 0 10rpx;
		font-weight: bolder;
		color: #777777;
	}

	.slot-wrap {
		display: flex;
		align-items: center;
		flex: 1;
	}

	.search-wrap {
		margin: 0 10rpx;
		flex: 1;
	}

	.gridnavtxt {
		color: #ffffff
	}

	.indicator-dots-item {
		background-color: #909399;
		height: 8rpx;
		width: 26rpx;
		border-radius: 20rpx;
		margin: 0 6rpx;
	}

	.indicator-dots-active {
		background-color: #2979ff;
	}


	/* #ifndef APP-NVUE */
	view {
		display: flex;
		box-sizing: border-box;
		flex-direction: column;
	}

	/* #endif */
	.pages {
		background-color: #FFFFFF;
	}

	.avatar {
		width: 200rpx;
		height: 200rpx;
		margin-right: 10rpx;
	}

	.catePop {
		width: 30%;
		background: #333333;
		position: fixed;
		right: 3%;
		border-radius: 16rpx;
	}

	.main {
		justify-content: space-between;
	}

	.title {
		width: 480rpx;
		font-size: 32rpx;
	}

	.info {
		flex-direction: row;
		justify-content: space-between;
	}

	.author,
	.last_modify_date {
		font-size: 28rpx;
		color: #999999;
	}

	.refresh-tip {
		color: #67c23a;
		font-size: 14px;
		line-height: 40px;
		text-align: center;
		background-color: #f0f9eb;
		height: 0;
		opacity: 0;
		transform: translateY(-100%);
		transition: height 0.3s;
	}

	.uni-search-box {
		background-color: #FFFFFF;
		position: sticky;
		top: 0;
		left: 0;
		/* #ifndef APP-PLUS */
		z-index: 9;
		/* #endif */
		/* #ifdef MP-WEIXIN */
		width: 580rpx;
		/* #endif */
	}

	.show-refresh-tip {
		transform: translateY(0);
		height: 40px;
		opacity: 1;
	}

	.get-data-state {
		width: 750rpx;
		align-items: center;
	}

	.get-data-state-img {
		width: 500rpx;
	}

	.get-data-state-text {
		width: 32rpx;
		color: #999999;
		line-height: 50rpx;
		height: 50rpx;
		width: 750rpx;
		text-align: center;
	}

	.uni-list {}

	.f1 {
		flex: 1;
	}

	.cover-search-bar {
		height: 50px;
		position: relative;
		top: -50px;
		margin-bottom: -50px;
		/* #ifndef APP-NVUE */
		z-index: 999;
		/* #endif */
	}
</style>
